import apibase from "@/api/apiBase";
import axios from "axios";
import { calculatePayMoneyInterface, creatGroupInterface, onlinePayInterface, payInterface} from "./order.interface";

//计算保费
export const $calculatePayMoney = (params: calculatePayMoneyInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/order/calculatePayMoney',
    data: params,
    instance,
  });
}

//提交投保[团单]
export const $creatGroup = (params: creatGroupInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/order/creatGroup',
    data: params,
    instance,
  });
}


// 支付团单(余额支付)
export const $pay = (params: payInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/pay/pay',
    data: params,
    instance,
  });
}

// 支付团单(线上支付)
export const $onlinePay = (params: onlinePayInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/pay/onlinePay',
    data: params,
    instance,
  });
}
//批量导入被保人
export const $importPeople = (params:any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/order/importPeople',
    data:{},
    formData:params,
    instance,
  });
}